Flash memories have become increasingly popular in recent years. A typical flash memory includes a memory array having a large number of memory cells arranged as an array. Each of the memory cells is fabricated as a field-effect transistor having a control gate and a floating gate. The floating gate is capable of holding charges, and is separated from source and drain regions contained in a substrate by a layer of thin oxide. Each of the memory cells can be electrically charged by injecting electrons from the substrate into the floating gate. The charges can be removed from the floating gate by tunneling the electrons to the source region or an erase gate during an erase operation. The data in flash memory cells are thus determined by the presence or absence of charges in the floating gates.